#ifndef _executor_h_
#define _executor_h_

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    NORTH,
    EAST,
    SOUTH,
    WEST,
} Direction;

typedef struct postion {
    int x, y;

} Postion;

typedef struct exectutor {
    Postion   p;
    Direction heading;
    Postion   alertPos;
    Postion   cleanPos;
    int       haveClean;
} Executor;

Executor *executor_create();
Postion   executor_get_pos(const Executor *);
void      ExecutorInit(Executor *);

void Forward(Executor *e);
void Backward(Executor *e);
void TurnRound(Executor *e);

typedef enum {
    ALERT_EMEGE = 3,
} AlertType;
void SetAlertPos(Executor *, Postion);
typedef void (*AlertFunc)(int type, int x, int y);
void RegAlertFunc(AlertFunc fn);

void SetCleanPos(Executor *, Postion p);
typedef void (*CleanFunc)(int x, int y);
void RegCleanFunc(CleanFunc fn);

#ifdef __cplusplus
}
#endif

#endif